package homework3;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 使用线程池将一个目录中的所有内容拷贝到另外一个目录中，包含子目录中的内容
 */
public class ThreadCopyTest {

    public static void main(String[] args) {

        //1，准备好数据
        PreparationData pd = new PreparationData();
        pd.preparation("D:/origin_data");
        //使用线程池进行复制数据
        //创建线程池
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        //布置任务
        executorService.submit(new TheadCopy());
        //关闭线程
        executorService.shutdown();
    }
}
